<%-- 
    Document   : excluir
    Created on : 01/04/2011, 22:01:20
    Author     : andre
--%>

<%@page import="classes.Contato"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<jsp:useBean id="daoContato" scope="request" class="classesDAO.DAOContato" />
<jsp:useBean id="contato" scope="request" class="classes.Contato" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%

  
  int id=0;
  String op="";

  if((request.getParameter("id")!=null)&&(request.getParameter("id")!=""))
       id= Integer.parseInt(request.getParameter("id"));

  if(request.getParameter("op")!=null)
        op= request.getParameter("op");

  if((id>0)&&(op.equals("excluir"))){
       daoContato.excluir(id);
       response.sendRedirect("listacontatos.jsp");
   }
 
%>
    </body>
</html>
